package Domestic;

public class IfTest2 {
	public static void main(String[] args){
		InStack myStack;
		FixedStack fs = new FixedStack(5);
		DynamicStack ds = new DynamicStack(8);
		myStack = fs;
		for (int i=1; i<=5; i++)
			myStack.push(i);
		for (int i=1; i<=5; i++)
			System.out.print(myStack.pop() + " ");
		
		myStack = ds;
		for (int i=1; i<=12; i++)
			myStack.push(i);
		for (int i=1; i<=12; i++)
			System.out.print(myStack.pop() + " ");
		// method calls are resolved at runtime
	}

}
